﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>商品管理</title>
    <script src="js/jquery-1.12.4.js"></script>
    <!--
    <link href="css/shopManage.css" rel="stylesheet" /> 
    <script src="../wjs/shopManage-.js"></script>
  连接外部时,修改后不会同步更新,仍然使用的是旧缓存-->
    <style>
        /*主框架*/
        * {
            margin: 0;
        }

        body {
            overflow: auto;
            font-family: "Microsoft YaHei", yaHei;
            font-size: 16px;
            background-image: url(img/mosha.jpg);
            position: relative;
        }

        .w {
            text-align: center;
        }

        .head {
            height: 70px;
            width: 100%;
            background-color: #2189BF;
        }

        .sidebar {
            float: left;
            width: 250px;
            background-color: #2A2E3D;
            padding-bottom: 99999px;
            margin-bottom: -99999px;
        }

        .main {
            float: left;
            width: 1100px;
            min-height: 900px; /**/
            background-color: #EEEDED;
            padding-bottom: 99999px;
            margin-bottom: -99999px;
        }

        .layer {
            margin: 0 auto;
            width: 1350px; /*必须,限制居中*/
            text-align: center;
            overflow: hidden;
        }
        /*m框架(模块)*/
        .main- > div {
            height: 300px;
        }
        /**/
        .m1 {
            height: 30px;
            background-color: #D4CECE;
            border: 2px solid #D4CECE;
            box-shadow: 1px 1px 1px 1px #D4CECE;
        }

        .m2 {
            height: 200px; /**/
        }

            .m2 > div {
                float: left;
            }

        .m3 {
            margin-left: 50px;
            overflow: hidden;
        }

            .m3 > div {
                float: left;
                margin: 15px;
            }

        .m4 {
        }
        /*一些模块*/
        .s1 {
            height: 150px;
        }

            .s1 > div:nth-child(1) {
                text-align: left;
                font-size: 18px;
                padding-left: 20px;
                margin-top: 10px;
                color: lightgray;
            }

            .s1 > div:nth-child(2) {
                text-align: left;
                font-size: 25px;
                margin-top: 20px;
                color: white;
                padding-left: 50px;
            }

            .s1 > div:nth-child(3) {
                text-align: left;
                font-size: 18px;
                padding-left: 20px;
                margin-top: 10px;
                color: lightgray;
            }

        .s2 > div {
            height: 40px;
            font-size: 30px;
            border: 1px solid #40455A;
            padding: 10px;
            color: #576477;
        }

            .s2 > div:hover {
                color: white;
                cursor: pointer;
                background-color: #383D4E;
            }

        .fe1table {
            position: relative;
            width: 580px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0px 0px 15px 2px lightgray;
        }

            .fe1table > div:nth-child(1) {
                height: 22px;
                padding: 5px;
                background-color: lightcyan;
                border-radius: 10px 10px 0 0;
            }

            .fe1table > div:nth-child(2) {
                overflow: hidden; /*会有边距塌陷*/
                position: relative;
                z-index: 100;
                margin-left: 25px;
                margin-top: 15px;
                margin-bottom: -2px;
            }

        .leibie { /*.fe1table>div:nth-child(2)>div*/
            float: left;
            background-color: #E3E3E3;
            border: 1px solid #E3E3E3;
            margin: 0 5px;
            padding: 6px 15px;
            border-radius: 5px;
            font-size: 15px;
            z-index: 50;
        }

        .fe1table > div:nth-child(2) > div:hover { /*应该该为点击事件*/
            cursor: pointer;
        }

        .xuanzhong {
            background-color: #fff;
            border-radius: 5px 5px 0 0;
            border-bottom-style: none !important;
            border: 1px solid #999999;
        }

        .tdxuanz {
            background-color: lavenderblush;
        }
        /**/
        .fe1table > div:nth-child(3) {
            border: 1px solid #999999;
            margin: 0px 20px 30px 20px;
            border-radius: 10px;
            position: relative;
            z-index: 10;
        }

        .fe1table table {
            border-collapse: collapse;
            width: 500px;
            margin: 20px;
            color: #2A2E3D;
            border: solid thin #999999;
        }

        .fe2tag {
            overflow: hidden; /*清除塌陷*/
            padding-bottom: 20px;
            width: 360px;
            margin-top: 30px;
            margin-left: 40px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0px 0px 15px 2px lightgray;
        }

            .fe2tag > div:nth-child(1) {
                padding: 3px;
                height: 25px;
                background-color: lightcyan;
                border-radius: 10px 10px 0 0;
            }

            .fe2tag > div:nth-child(2) {
                margin: 0px 0;
                font-size: 25px;
                text-align: left;
                padding: 10px 20px;
                overflow: hidden; /*清塌陷*/
            }

                .fe2tag > div:nth-child(2) div {
                    float: left;
                    width: 100px;
                    height: 40px;
                    margin: 10px;
                }

                .fe2tag > div:nth-child(2) > div:nth-child(1) { /**/
                    width: 180px;
                    margin-bottom: 0px;
                    color: #2A2E3D;
                }

                .fe2tag > div:nth-child(2) > div:nth-child(2) { /**/
                    margin-left: 0px;
                    background-color: lavender;
                }

            .fe2tag > div:nth-child(3) {
                overflow: hidden; /*清塌陷*/
            }

                .fe2tag > div:nth-child(3) > div > div {
                    float: left;
                    height: 40px;
                    margin: 10px;
                    width: 150px;
                    font-size: 15px;
                    color: gray;
                    margin-top: 5px;
                    border-bottom: 1px solid lightgray;
                    overflow: hidden; /*清塌陷*/
                }

                    .fe2tag > div:nth-child(3) > div > div > div {
                        font-size: 18px;
                        float: right;
                        text-align: left;
                        margin-top: 10px;
                        width: 80px;
                        color: #C04D4D;
                        font-weight: 800;
                    }

        .fet2ku {
            padding-bottom: 50px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 0 15px 2px lightgray;
            margin-left: 100px;
            margin-top: 30px;
            width: 750px;
            float: left;
            text-align: center;
        }

            .fet2ku > div:nth-child(1) {
                /*标题*/
                background-color: lightcyan;
                border-radius: 10px 10px 0 0;
                height: 30px;
                margin-bottom: 10px;
            }

            .fet2ku > div:nth-child(2) {
                /*fetable内容*/
                /*height: 200px;视情况而定*/
                padding: 10px;
                padding-bottom: 40px;
            }

                .fet2ku > div:nth-child(2) > div {
                    /*border: 1px solid gainsboro;*/
                }

                    .fet2ku > div:nth-child(2) > div:nth-child(1) {
                        margin-bottom: 10px;
                    }

                    .fet2ku > div:nth-child(2) > div:nth-child(2) > * {
                        margin: 0 5px;
                        font-size: 18px;
                        max-width: 120px;
                    }

        .fe3table {
            /*m33> div:first-child */
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 0 15px 2px lightgray;
            margin-left: 100px;
            margin-top: 30px;
            width: 750px;
            float: left;
            text-align: center;
        }

            .fe3table > div:nth-child(1) {
                /*标题*/
                background-color: lightcyan;
                border-radius: 10px 10px 0 0;
                height: 30px;
                margin-bottom: 10px;
            }

            .fe3table > div:nth-child(2) {
                /*fetable内容*/
                /*height: 200px;视情况而定*/
                padding: 10px;
                padding-bottom: 40px;
            }

            .fe3table table {
                width: 100%;
                border-collapse: collapse;
                color: #2A2E3D;
                border: solid thin #999999;
            }

            .fe3table tr {
                height: 35px;
            }



        .fet1zong {
            height: 150px;
            width: 1000px;
            margin-top: 20px;
            margin-left: 50px;
        }

            .fet1zong > div:nth-child(1) {
                width: 220px;
                height: 40px;
                margin: 5px;
                font-size: 20px;
                font-weight: bold;
            }

            .fet1zong > div:nth-child(2) {
                height: 100px;
            }

                .fet1zong > div:nth-child(2) > div {
                    /*每个总额模块*/
                    width: 180px;
                    height: 80px;
                    background-color: white;
                    display: inline-block;
                    font-size: 14px;
                    text-align: left;
                    margin: 5px 15px;
                }

                    .fet1zong > div:nth-child(2) > div > div:first-child {
                        width: 50px;
                        margin: 10px 20px;
                        color: gray;
                        display: inline-block;
                    }

                        .fet1zong > div:nth-child(2) > div > div:first-child > p:last-child {
                            margin-top: 5px;
                            font-size: 30px;
                            font-weight: bolder;
                            color: brown;
                        }

                    .fet1zong > div:nth-child(2) > div > div:last-child {
                        width: 50px;
                        height: 50px;
                        background-color: white;
                        display: inline-block;
                        margin-top: 20px;
                        background-color: darkcyan;
                        margin-left: 27px;
                        margin-top: 10px;
                    }

        .fet-- {
            height: 200px;
            margin: 25px;
            background-color: white;
            box-shadow: 0px 0px 15px 2px lightgray;
        }

        .mb21 {
            margin-left: 50px;
        }


        /*-----登陆------*/

        .login {
            margin-top: 300px;
            border: 1px solid skyblue;
            width: 500px;
            margin: 200px auto;
            /*要改自适应居中*/
            padding: 15px;
            background-color: #D2EDF3;
            box-shadow: 0 0 10px 2px #fff;
        }



        .log1 {
            border-bottom: 1px solid skyblue;
            font-size: 25px;
            font-weight: bolder;
            margin: 15px;
            text-align: center;
            color: #4F6153;
        }

        .login .d {
            margin: 0 auto;
            width: 450px;
            text-align: right;
            font-family: "微软雅黑";
            font-size: 15px;
            color: #40455A;
        }

            .login .d > div {
                margin: 20px;
            }

                .login .d > div input {
                    width: 280px;
                    height: 25px;
                    margin: 0 10px;
                    border-radius: 5px;
                    border-style: solid;
                    border-color: #BDD9DC;
                    outline-style: none;
                    background-color: #C4F2EF;
                    padding: 0 10px;
                    color: #4F6153;
                }

                    .login .d > div input:focus {
                        border-color: lightskyblue;
                    }

                .login .d > div > div {
                    /*提示*/
                    display: none;
                    margin: 5px 0px 0px 100px;
                    width: 300px;
                    text-align: left;
                    color: lightgray;
                    font-size: 12px;
                }

        .login #tijiao {
            width: 100px;
            height: 30px;
            border-color: dodgerblue;
            background-color: #98AEEC;
            outline: none;
            color: white;
            border-radius: 2px;
            margin-right: 40px;
        }

        .login span {
            margin-left: 30px;
            color: darkcyan;
            padding: 20px;
            cursor: pointer;
        }



        td:hover {
            background-color: lavenderblush;
            cursor: pointer;
        }

        .fe3table tr:hover {
            background-color: lavenderblush;
        }

        .fzhuce {
            display: none;
        }

        .zhuce:hover {
            cursor: pointer;
        }
    </style>
</head>
<body>
    <form id="form1">
        <div class="w">

            <div class='login'>
                <div class='log1'>
                    商品管理系统
                </div>
                <div class='d'>
                    <div class=''>
                        名称
                        <input type='text' id='inp1' />
                        <div class='tishi'>
                            长度必须为 4 ~6 个英文数字字符
                        </div>
                    </div>
                    <div class=''>
                        密码
                        <input type='password' id='inp2' />
                        <div class='tishi'>
                            包含字母数字 ,至少6位
                        </div>
                    </div>
                    <div class='fzhuce'>
                        密码确认
                        <input type='password' id='inp3' />
                        <div class='tishi'>
                            请重复输入密码
                        </div>
                    </div>
                    <span class='zhuce'>注册</span>
                    <input type='submit' id='tijiao' value='登陆' />
                    <input type='text' id='login' value='denglu' style="display: none" />
                </div>
            </div>

        </div>
    </form>
</body>
</html>
<script>
    $(function () {/*主*/
        $("#tijiao").click(function () {
            $.ajax({
                type: "POST",
                url: "Default.aspx",
                data: "login=" + $("#login").val() + "&name=" + $("#inp1").val() + "&mima=" + $("#inp2").val(),
                success: function (msg) {
                    $(".w").html(msg)

                    a1();//加载页面后需要重新绑定事件
                    a2();
                    a3();
                }
            });
            return false;
        });

        bx = true;
        $(".zhuce").click(function () {
            if (bx) {
                $(".fzhuce").css("display", "block")
                $(".zhuce").html("登陆")
                $("#tijiao").val("确认注册")
                $("#login").val("zhuce")
                bx = false;
            } else {
                $(".fzhuce").css("display", "none")
                $(".zhuce").html("注册")
                $("#tijiao").val("登陆")
                $("#login").val("denglu")
                bx = true;
            }

        })

    })

    function a1() {
        $(".x1").click(function () {//商品存入
            //  alert('32')
            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=mingxi",
                success: function (msg) {
                    $(".main").html(msg)
                    a2();
                    a3();
                }
            });
            return false;
        });

        $(".x2").click(function () {//商品存入
            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=cunru",
                success: function (msg) {
                    $(".main").html(msg)

                    a4();//加载页面后需要重新绑定事件
                    ruke();
                }
            });
            return false;
        });

        $(".x3").click(function () {//商品存入
            // alert('33')
            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=zhichu",
                success: function (msg) {
                    $(".main").html(msg)

                    a4();//加载页面后需要重新绑定事件
                    chuku();
                }
            });
            return false;
        });
    }

    function a2() {
        xzlb = $(".leibie").eq(0).addClass("xuanzhong")
        $(".leibie").click(function () {
            xzlb.removeClass("xuanzhong")
            xzlb = $(this).addClass("xuanzhong")
            var s = xzlb.text()
            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=leibie" + "&" + "name2=" + s,
                success: function (msg) {
                    $(".ftable").html(msg)
                    a3();
                }
            })
        })
    }
    function a3() {
        xz = $(".ftable td").eq(0).addClass("tdxuanz")
        $(".ftable td").click(function () {
            // alert($(this).text())
            xz.removeClass();
            xz = $(this).addClass("tdxuanz")
            var vx = $(this).text();
            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=shangpin" + "&" + "name2=" + vx,
                success: function (msg) {
                    $(".fe2tag").html(msg)

                }
            })
        })
        xz.trigger("click")
    }
    function a4() {
        $(".selelei").change(function () {
            var vx = $(this).val();
            //alert(vx)
            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=selelei" + "&" + "name2=" + vx,
                success: function (msg) {
                    $(".seleshang").html(msg)

                }
            })
        })
    }
    function ruke() {
        $(".ruku").click(function () {
            var sx1 = $(".selelei").val();
            var sx2 = $(".seleshang").val();
            var sx3 = $(".inp1").val();

            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=ruku&leibie=" + sx1 + "&shangpin=" + sx2 + "&inp=" + sx3,
                success: function (msg) {
                    $(".caozuo").html(msg)

                }
            });
        })
    }
    function chuku() {
        $(".chuku").click(function () {
            var sx1 = $(".selelei").val();
            var sx2 = $(".seleshang").val();
            var sx3 = $(".inp1").val();

            $.ajax({
                type: "POST",
                url: "Default2.aspx",
                data: "name=chuku&leibie=" + sx1 + "&shangpin=" + sx2 + "&inp=" + sx3,
                success: function (msg) {
                    $(".caozuo").html(msg)

                }
            });
        })
    }
</script>
